package com.zking.frame.LYK;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import com.zking.frame.TJ.JDBC.GetUserid;

public class GetUser {

	public List<Object> getUserMsg(){
		Connection conn=JDBC.getConn();
		List<Object> list= new ArrayList<Object>();
		String sql="select username,user_id,phone from user where user_id ="+ GetUserid.getId();
		Statement st=null;
		ResultSet rt=null;
		try {
			st= conn.createStatement();
			rt =st.executeQuery(sql);
			while(rt.next()){
				int user_id=rt.getInt("user_id");
				list.add(user_id);
				String username=rt.getString("user_id");
				list.add(username);
				String phone=rt.getString("phone");
				list.add(phone);
			}
			
			
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		finally {
			try {
				st.close();
				rt.close();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}
		
		return list;
	}
}
